//错误信息配置文件

module.exports = {
  //login 登录
  LOGIN: {
    //invalid_username_length
    INVALID_USERNAME_LENGTH: {
      error_code: 10001,
      err_msg: 'Invalid username length.'
    },
    INVALID_PASSWORD_LENGTH: {
      error_code: 10002,
      error_msg: 'Invalid password length.'
    },
    USERNAME_NOT_EXIST: {
      error_code: 10003,
      error_msg: 'Username is not exist in database.'
    },
    PASSWORD_ERROR: {
      error_code: 10004,
      error_msg:'Password donsn\'t matched with the username.'
    },
    //非法操作
    INVALID_OPERATION: {
      error_code: 10005,
      error_msg: 'Invalid opration! Username or password is not be send.'
    },
    NOT_LOGIN_STATUS: {
      error_code: 10006,
      error_msg: 'It is not loged status'
    },
    LOGIN_STATUS: {
      error_code: 10007,
      error_msg: 'It is loged status'
    },
    //退出成功 logout_success
    LOGOUT_SUCCESS: {
      error_code: 0, //成功返回0
      error_msg: 'logout is ok'
    },
    //成功登录
    SUCCESS: {
      error_code:0,
      error_msg: 'Login is ok!'
    }
  },
  API: {
    RETURN_SUCCESS: {
      error_code: 0,
      error_msg: 'Data is returned successfuly.' 
    },
    //return failed
    RETURN_FAILED: {
      error_code: 20001,
      error_msg: 'It is failed to return data.'
    },
    CHANGE_COURSE_FIELD_SUCCESS: {
      error_code: 0,
      error_msg: 'Changing course field successfully.'
    },
    CHANGE_COURSE_FIELD_FAILED: {
      error_code: 20002,
      error_msg: 'It is failed to change course field.'
    },
    CHANGE_COURSE_STATUS_SUCCESS: {
      error_code: 0,
      error_msg: 'Changing course status successfully.'
    },
    CHANGE_COURSE_STATUS_FAILED: {
      error_code: 20003,
      error_msg: 'Changing course status failed.'
    },
    CHANGE_RECOM_COURSE_STATUS_SUCCESS: {
      error_code: 0,
      error_msg: 'Changing recoment course status successfully.'
    },
    CHANGE_RECOM_COURSE_STATUS_FAILED: {
      error_code: 20004,
      error_msg: 'Changing recoment course status failed.'
    },
    CHANGE_STATUS_SUCCESS: {
      error_code: 0,
      error_msg: 'Changing status successfully.'
    },
    CHANGE_STATUS_FAILED: {
      error_code: 20003,
      error_msg: 'Changing status failed.'
    },
    FIELD_ERROR: {
      error_code: 20005,
      error_msg: 'It is a wrong field for the operation.'
    },
    SELECT_STAR_TEACHER_SUCCESS: {
      error_code: 0,
      error_msg: 'Selecting star teacher successfully.'
    },
    SELECT_STAR_TEACHER_FAILED: {
      error_code: 20006,
      error_msg: 'Selecting star teacher failed.'
    }
  },
  //crawler 爬虫
  CRAWLER: {
    CRAWL_SUCCESS: {
      error_code: 0,
      error_msg: 'Crawling data successfully.'
    },
    CRAWL_FAILED: {
      error_code: 30001,
      error_msg: 'It is failed to crawl data.'
    }
  }
}

